package com.cib.process.chat.core.handler.impl;

import com.cib.process.bean.CheckType;
import com.cib.process.bean.ServiceResult;
import com.cib.process.chat.bean.Completekey;
import com.cib.process.chat.bean.MoneyActionResult;
import com.cib.process.chat.bean.PlayType;
import com.cib.process.chat.bean.QueryResult;
import com.cib.process.chat.core.handler.ActionHandler;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;

/**
 *  1003金额处理
 */
@Service
public class MoneyActionHandler implements ActionHandler {
    @Value("${action.1003.result.minkey:3}")
    private String minkey;
    @Value("${action.1003.result.maxkey:3}")
    private String maxkey;
    @Value("${action.1003.result.canbreak:N}")
    private String canbreak;
    @Value("${action.1003.result.recordflag:N}")
    private CheckType recordflag;
    @Value("${action.1003.result.poundflag:3}")
    private CheckType poundflag;
    
    
    @Override
    public ServiceResult execute(QueryResult queryResult) {
        MoneyActionResult result=new MoneyActionResult();
        result.setMinkey(minkey);
        result.setMaxkey(maxkey);
        result.setCompletekey(Completekey.NUM.getCode());
        result.setType(PlayType.TTS);
        result.setContext(queryResult.getSuggestAnswer());
        result.setCanbreak(canbreak);
        result.setRecordflag(recordflag);
        result.setPoundflag(poundflag);

        return ServiceResult.buildSuccessResult(result,queryResult.getSessionId(),queryResult.getAction());
    }
}
